﻿

<div class="modal fade" id="userinfo-dialog">
    <div class="modal-dialog">
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">用户信息</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <div class="form-horizontal">
                <div class="box-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">ID：</label>
                        <div class="col-sm-8">
                            <input type="text"  value="0" class="form-control" id="user-id" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户名：</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="user-username" placeholder="用户名长度限制为4~8位" maxlength="8" required>
                        </div>
                        <label class="control-label icon-sign"><i class="icon">*</i> 必填</label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">密码：</label>
                        <div class="col-sm-8">
                            <input type="password" class="form-control" id="user-password" placeholder="密码长度限制为6~20位" maxlength="16" required>
                        </div>
                        <label class="control-label icon-sign"><i class="icon">*</i> 必填</label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">确认密码：</label>
                        <div class="col-sm-8">
                            <input type="password" class="form-control" id="user-password2" placeholder="二次确认密码" maxlength="16" required>
                        </div>
                        <label class="control-label icon-sign"><i class="icon">*</i> 必填</label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">姓名：</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="user-name" placeholder="真实姓名" required>
                        </div>
                        <label class="control-label icon-sign"><i class="icon">*</i> 必填</label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">联系方式：</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="user-phone" placeholder="手机号码" required>
                        </div>
                        <label class="control-label icon-sign"><i class="icon">*</i> 必填</label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">邮箱地址：</label>
                        <div class="col-sm-8">
                            <input type="email" class="form-control" id="user-email" placeholder="邮箱地址">
                        </div>
                    </div>
                </div>
                <!-- /.box-body -->
                <div class="box-footer"> 
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-info pull-right" onclick="save()">保存</button>
                </div>
                <!-- /.box-footer -->
            </div>
        </div> 
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>

<script>
    //upload img
    function uploadfile() {
        var file = $("#input-userimg")[0].files[0];
        var data = new FormData();
        data.append('file', file);
        $.ajax({
            url: "/Account/UserList?handler=Upload",
            type: 'POST',
            data: data,
            contentType: false,
            processData: false, 
            success: function (returndata) {
                $("#user-img").attr('src', returndata.path);
            },
            error: function (a, b, c) {
                alert('上传失败')
            }
        });
    };
</script>